<template>
  <div class="sub-box-border body">
    <div class="left-align sub-title">数据</div>
    <el-divider></el-divider>
    <div>
      <el-table
        v-loading="loading"
        :data="statistic"
        stripe
        height="700px"
        style="width: 100%">
        <el-table-column
          type="index"
          label="编号"
          width="180">
        </el-table-column>
        <el-table-column
          prop="statisticName"
          label="项目名称"
          width="180">
        </el-table-column>
        <el-table-column
          prop="statisticCount"
          label="点击量"
          width="180">
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
    export default {
      name: "Statistic",
      data(){
        return{
          loading: false,
          statistic:[]
        }
      },
      methods:{
        getStastic:function(){
          let data = this.$data;
          const qs = require("qs");
          data.loading=true;
          this.axios.post('/statistic/getall')
            .then(response => {
              let resData = response.data;
              if(resData.errCode == 200){
                data.statistic = resData.data;
              }else{
                alert(resData.errMsg);
              }
              data.loading=false;
            })
        }
      },
      created(){
        this.getStastic();
      }
    }
</script>

<style scoped>
  .body{
    width: 100%;
    height: 100%;
    padding: 10px;
    box-sizing: border-box;
  }
</style>
